import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase11="DBshop011_添加商品流程"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','管理商品')
firefox.find_element_by_partial_link_text('添加商品').click()# 进入添加商品页面
firefox.find_element_by_id("goods_name").send_keys('苹果XR')
firefox.find_element_by_id("goods_shop_price").send_keys('7999')# 选择金额
firefox.find_element_by_xpath('//option[text()="虚拟商品"]').click()
firefox.find_element_by_xpath('//button[@type="submit"]').click() #创建商品

firefox.find_element_by_name('goods_name').send_keys('苹果XR')

firefox.find_element_by_xpath('//button[contains(text(),"搜索")]').click()

string=firefox.find_element_by_link_text('编辑').text

try:
    string=='编辑'
    writeLog("%s 测试通过"%testCase11)
except:
    writeLog('%s 测试不通过'%testCase11)











